package com.zzy.springboot_shiro.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author 邹靓仔
 * @date 2020/3/19 -20:15 -user-perm
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("role")
public class Role implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer roleId;
    private String roleName;

    //角色 -- 权限关系：多对多关系;
    @TableField(exist = false)
    private List<Permission> permissions;

    @Override
    public String toString() {
        return "Role{" + roleId +
                ", " + roleName + '\'' +
                ", " + permissions +
                '}';
    }

}
